package org.learn.test;

public class HomeWork01 {
    public static void main(String[] args) {
        //收过路费，大于五万收百分之五，小于五万收一千每次，输出十万块能过路次数
        int count = 0;
        double j = 100000;
        while(true){
            if(j > 50000){
                j *= 0.95;
                count++;
            }else if (j >= 1000 && j <= 50000){
                j -= 1000;
                count++;
            }else{
                break;
            }
        }
        System.out.println(count);
        System.out.println(j);
    }
}
